/*
定义日志的等级：
    7个等级，
    1.UNKNOW、2.DEBUG、3.INFO、4.WARN、5.ERROR、6.FATAL、7.OFF
*/
#ifndef __M_LEVEL_H__ //防止头文件重复包含
#define __M_LEVEL_H__

namespace log
{
    class Level
    {
    public:
        enum class value
        {
            UNKNOW = 0,
            DEBUG,
            INFO,
            WARN,
            ERROR,
            FATAL,
            OFF
        };
        static const char *toString(Level::value level)
        {
            switch (level)
            {
            case Level::value::DEBUG:
                return "DEBUG";
            case Level::value::INFO:
                return "INFO";
            case Level::value::WARN:
                return "WARN";
            case Level::value::ERROR:
                return "ERROR";
            case Level::value::FATAL:
                return "FATAL";
            case Level::value::OFF:
                return "OFF";
            default:
                break;
            }
            return "UNKNOW";
        }
    };
}
#endif 